package com.azhoucode.controller;

import com.azhoucode.common.SimpleResponse;
import com.azhoucode.service.GenerateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: 代码生成器接口层
 * @author: azhou
 * @create: 2021-12-14 15:32
 **/
@RestController
@RequestMapping("/generator")
public class GeneratorController {

    @Autowired
    private GenerateService generateService;

    /**
     * 代码生成
     */
    @GetMapping("/{random}/{type}")
    public SimpleResponse generator(@PathVariable("random") String random,@PathVariable("type") Integer type) throws Exception {
        generateService.generateCode(random,type);
        return SimpleResponse.success();
    }

}
